<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>${FORUMS_INFO.forumTopic}</h1>
<h2>${FORUMS_INFO.forumContexts}</h2>
<hr/>
<table border="1" width="70%" align="center">
    <tr>
        <th>序号</th>
        <th width="50%">标题</th>
        <th>作者</th>
        <th width="30%">时间</th>
    </tr>
    <c:forEach var="hi" items="${HOME_POST_BY_ID}" varStatus="j">
        <tr>
            <td>${j.count}</td>
            <td><a href="homeposts?type=find&id=${hi.homePostId}">${hi.homePostTitle}</a></td>
            <td>${hi.userId}</td>
            <td>${hi.sendDate}</td>
        </tr>
    </c:forEach>
</table>
<form action="homeposts" method="post">
    <input type="hidden" name="userId" value="${USER_INFO.userId}">
    <input type="hidden" name="forumId" value="${FORUMS_INFO.forumId}">
    <input type="hidden" name="type" value="save">
    <table border="1" width="70%" align="center">
        <tr>
            <th width="20%">标题</th>
            <td><input name="title"/></td>
        </tr>
        <tr>
            <th>内容</th>
            <td><textarea rows="30%" cols="100%" name="content"></textarea></td>
        </tr>
        <tr>
            <th width="20%">心情说说</th>
            <td><input name="mood"/></td>
        </tr>
        <tr>
            <th colspan="2">
                <c:choose>
                    <c:when test="${empty USER_INFO}">
                        请登录后发表帖子
                    </c:when>
                    <c:otherwise>
                        <button>发表</button>
                    </c:otherwise>
                </c:choose>
            </th>
        </tr>
    </table>
</form>
</body>
</html>
